Skip to content

Comments

Temporary fix, send only split log#357

Merged
S1ro1 merged 1 commit intomainfrom
too-long-thread-fix
Sep 14, 2025
Merged

Temporary fix, send only split log#357
S1ro1 merged 1 commit intomainfrom
too-long-thread-fix

Conversation

@S1ro1
Copy link
Member

@S1ro1 S1ro1 commented Sep 14, 2025

This is a temporary fix jsut so I can deploy the problem, we should probably remove the functionality to create threads anyway as they aren't particularly used.

Copilot AI review requested due to automatic review settings September 14, 2025 10:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a temporary fix to prevent deployment issues by truncating leaderboard descriptions to 1500 characters when creating forum threads. The change addresses a length limit constraint in the Discord API.

  • Truncates leaderboard descriptions to 1500 characters when they exceed this limit
  • Maintains original description when under the limit
  • Applied specifically to the forum thread creation functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +281 to +282
definition.description[:1500]
if len(definition.description) > 1500
Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number 1500 is repeated and hardcoded. Consider defining it as a constant (e.g., MAX_DESCRIPTION_LENGTH = 1500) to improve maintainability and make the limit clear.

Suggested change
definition.description[:1500]
if len(definition.description) > 1500
definition.description[:MAX_DESCRIPTION_LENGTH]
if len(definition.description) > MAX_DESCRIPTION_LENGTH

Copilot uses AI. Check for mistakes.
Comment on lines +281 to +283
definition.description[:1500]
if len(definition.description) > 1500
else definition.description,
Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The length check len(definition.description) > 1500 is performed after already slicing the string. Consider checking the length first to avoid unnecessary string slicing: definition.description[:1500] if len(definition.description) > 1500 else definition.description

Suggested change
definition.description[:1500]
if len(definition.description) > 1500
else definition.description,
definition.description[:1500] if len(definition.description) > 1500 else definition.description,

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

@S1ro1 S1ro1 merged commit 203cebe into main Sep 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant